<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perlsource - A guide to the Perl source tree - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perlsource">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlsource.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perlsource">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perlsource">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perlsource">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perlsource">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perlsource">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perlsource">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perlsource">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perlsource">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perlsource">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perlsource">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perlsource">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perlsource">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perlsource">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perlsource">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perlsource">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perlsource">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perlsource">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perlsource">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perlsource">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perlsource">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perlsource">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perlsource">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perlsource">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perlsource">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perlsource">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perlsource">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perlsource">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perlsource">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perlsource">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perlsource">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perlsource">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perlsource">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perlsource">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perlsource">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perlsource">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perlsource">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perlsource">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perlsource">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perlsource">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perlsource">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perlsource">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perlsource">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perlsource">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perlsource">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perlsource">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perlsource">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perlsource">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perlsource">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perlsource">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perlsource">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perlsource">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perlsource">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perlsource">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perlsource">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perlsource">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perlsource">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perlsource">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perlsource">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perlsource">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perlsource">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perlsource">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perlsource">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perlsource">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perlsource">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perlsource">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perlsource">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perlsource">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perlsource">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perlsource">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perlsource">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perlsource">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perlsource">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perlsource">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perlsource">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perlsource">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perlsource">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perlsource">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perlsource">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perlsource">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perlsource">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlsource.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perlsource">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perlsource">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perlsource">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perlsource">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perlsource">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perlsource">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perlsource">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perlsource">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perlsource">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perlsource">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perlsource">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perlsource">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perlsource">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perlsource">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perlsource">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perlsource">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perlsource">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perlsource">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perlsource">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perlsource">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perlsource">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perlsource">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perlsource">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perlsource">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perlsource">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perlsource">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perlsource">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perlsource">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perlsource">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perlsource">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perlsource">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perlsource">5.35.1</a>
          <a class="dropdown-item active" href="perlsource.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlsource.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perlsource.html">perlsource</a>
          <div id="more">
            (<a href="perlsource.txt">source</a>,
            <a href="https://metacpan.org/pod/perlsource">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perlsource.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#DESCRIPTION">DESCRIPTION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#FINDING-YOUR-WAY-AROUND">FINDING YOUR WAY AROUND</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlsource.html#C-code">C code</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#Core-modules">Core modules</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#Tests">Tests</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#Documentation">Documentation</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#Hacking-tools-and-documentation">Hacking tools and documentation</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#Build-system">Build system</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#AUTHORS">AUTHORS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlsource.html#MANIFEST">MANIFEST</a>
              </li>
          </ul>

              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perlsource.html#NAME">#</a>NAME</h1>

<p>perlsource - A guide to the Perl source tree</p>

<h1 id="DESCRIPTION"><a class="permalink" href="perlsource.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>This document describes the layout of the Perl source tree. If you&#39;re hacking on the Perl core, this will help you find what you&#39;re looking for.</p>

<h1 id="FINDING-YOUR-WAY-AROUND"><a class="permalink" href="perlsource.html#FINDING-YOUR-WAY-AROUND">#</a><a id="FINDING"></a>FINDING YOUR WAY AROUND</h1>

<p>The Perl source tree is big. Here&#39;s some of the thing you&#39;ll find in it:</p>

<h2 id="C-code"><a class="permalink" href="perlsource.html#C-code">#</a><a id="C"></a>C code</h2>

<p>The C source code and header files mostly live in the root of the source tree. There are a few platform-specific directories which contain C code. In addition, some of the modules shipped with Perl include C or XS code.</p>

<p>See <a href="perlinterp.html">perlinterp</a> for more details on the files that make up the Perl interpreter, as well as details on how it works.</p>

<h2 id="Core-modules"><a class="permalink" href="perlsource.html#Core-modules">#</a><a id="Core"></a>Core modules</h2>

<p>Modules shipped as part of the Perl core live in four subdirectories. Two of these directories contain modules that live in the core, and two contain modules that can also be released separately on CPAN. Modules which can be released on cpan are known as &quot;dual-life&quot; modules.</p>

<ul>

<li><p><i>lib/</i></p>

<p>This directory contains pure-Perl modules which are only released as part of the core. This directory contains <i>all</i> of the modules and their tests, unlike other core modules.</p>

</li>
<li><p><i>ext/</i></p>

<p>Like <i>lib/</i>, this directory contains modules which are only released as part of the core. Unlike <i>lib/</i>, however, a module under <i>ext/</i> generally has a CPAN-style directory- and file-layout and its own <i>Makefile.PL</i>. There is no expectation that a module under <i>ext/</i> will work with earlier versions of Perl 5. Hence, such a module may take full advantage of syntactical and other improvements in Perl 5 blead.</p>

</li>
<li><p><i>dist/</i></p>

<p>This directory is for dual-life modules where the blead source is canonical. Note that some modules in this directory may not yet have been released separately on CPAN. Modules under <i>dist/</i> should make an effort to work with earlier versions of Perl 5.</p>

</li>
<li><p><i>cpan/</i></p>

<p>This directory contains dual-life modules where the CPAN module is canonical. Do not patch these modules directly! Changes to these modules should be submitted to the maintainer of the CPAN module. Once those changes are applied and released, the new version of the module will be incorporated into the core.</p>

</li>
</ul>

<p>For some dual-life modules, it has not yet been determined if the CPAN version or the blead source is canonical. Until that is done, those modules should be in <i>cpan/</i>.</p>

<h2 id="Tests"><a class="permalink" href="perlsource.html#Tests">#</a>Tests</h2>

<p>The Perl core has an extensive test suite. If you add new tests (or new modules with tests), you may need to update the <i>t/TEST</i> file so that the tests are run.</p>

<ul>

<li><p>Module tests</p>

<p>Tests for core modules in the <i>lib/</i> directory are right next to the module itself. For example, we have <i>lib/strict.pm</i> and <i>lib/strict.t</i>.</p>

<p>Tests for modules in <i>ext/</i> and the dual-life modules are in <i>t/</i> subdirectories for each module, like a standard CPAN distribution.</p>

</li>
<li><p><i>t/base/</i></p>

<p>Tests for the absolute basic functionality of Perl. This includes <code>if</code>, basic file reads and writes, simple regexes, etc. These are run first in the test suite and if any of them fail, something is <i>really</i> broken.</p>

</li>
<li><p><i>t/cmd/</i></p>

<p>Tests for basic control structures, <code>if</code>/<code>else</code>, <code>while</code>, subroutines, etc.</p>

</li>
<li><p><i>t/comp/</i></p>

<p>Tests for basic issues of how Perl parses and compiles itself.</p>

</li>
<li><p><i>t/io/</i></p>

<p>Tests for built-in IO functions, including command line arguments.</p>

</li>
<li><p><i>t/mro/</i></p>

<p>Tests for perl&#39;s method resolution order implementations (see <a href="mro.html">mro</a>).</p>

</li>
<li><p><i>t/op/</i></p>

<p>Tests for perl&#39;s built in functions that don&#39;t fit into any of the other directories.</p>

</li>
<li><p><i>t/opbasic/</i></p>

<p>Tests for perl&#39;s built in functions which, like those in <i>t/op/</i>, do not fit into any of the other directories, but which, in addition, cannot use <i>t/test.pl</i>,as that program depends on functionality which the test file itself is testing.</p>

</li>
<li><p><i>t/re/</i></p>

<p>Tests for regex related functions or behaviour. (These used to live in t/op).</p>

</li>
<li><p><i>t/run/</i></p>

<p>Tests for features of how perl actually runs, including exit codes and handling of PERL* environment variables.</p>

</li>
<li><p><i>t/uni/</i></p>

<p>Tests for the core support of Unicode.</p>

</li>
<li><p><i>t/win32/</i></p>

<p>Windows-specific tests.</p>

</li>
<li><p><i>t/porting/</i></p>

<p>Tests the state of the source tree for various common errors. For example, it tests that everyone who is listed in the git log has a corresponding entry in the <i>AUTHORS</i> file.</p>

</li>
<li><p><i>t/lib/</i></p>

<p>The old home for the module tests, you shouldn&#39;t put anything new in here. There are still some bits and pieces hanging around in here that need to be moved. Perhaps you could move them? Thanks!</p>

</li>
</ul>

<h2 id="Documentation"><a class="permalink" href="perlsource.html#Documentation">#</a>Documentation</h2>

<p>All of the core documentation intended for end users lives in <i>pod/</i>. Individual modules in <i>lib/</i>, <i>ext/</i>, <i>dist/</i>, and <i>cpan/</i> usually have their own documentation, either in the <i>Module.pm</i> file or an accompanying <i>Module.pod</i> file.</p>

<p>Finally, documentation intended for core Perl developers lives in the <i>Porting/</i> directory.</p>

<h2 id="Hacking-tools-and-documentation"><a class="permalink" href="perlsource.html#Hacking-tools-and-documentation">#</a><a id="Hacking"></a>Hacking tools and documentation</h2>

<p>The <i>Porting</i> directory contains a grab bag of code and documentation intended to help porters work on Perl. Some of the highlights include:</p>

<ul>

<li><p><i>check*</i></p>

<p>These are scripts which will check the source things like ANSI C violations, POD encoding issues, etc.</p>

</li>
<li><p><i>Maintainers</i>, <i>Maintainers.pl</i>, and <i>Maintainers.pm</i></p>

<p>These files contain information on who maintains which modules. Run <code>perl Porting/Maintainers -M Module::Name</code> to find out more information about a dual-life module.</p>

</li>
<li><p><i>podtidy</i></p>

<p>Tidies a pod file. It&#39;s a good idea to run this on a pod file you&#39;ve patched.</p>

</li>
</ul>

<h2 id="Build-system"><a class="permalink" href="perlsource.html#Build-system">#</a><a id="Build"></a>Build system</h2>

<p>The Perl build system on *nix-like systems starts with the <i>Configure</i> script in the root directory.</p>

<p>Platform-specific pieces of the build system also live in platform-specific directories like <i>win32/</i>, <i>vms/</i>, etc. Windows and VMS have their own Configure-like scripts, in their respective directories.</p>

<p>The <i>Configure</i> script (or a platform-specific similar script) is ultimately responsible for generating a <i>Makefile</i> from <i>Makefile.SH</i>.</p>

<p>The build system that Perl uses is called metaconfig. This system is maintained separately from the Perl core, and knows about the platform-specific Configure-like scripts, as well as <i>Configure</i> itself.</p>

<p>The metaconfig system has its own git repository. Please see its README file in <a href="https://github.com/Perl/metaconfig">https://github.com/Perl/metaconfig</a> for more details.</p>

<p>The <i>Cross</i> directory contains various files related to cross-compiling Perl. See <i>Cross/README</i> for more details.</p>

<h2 id="AUTHORS"><a class="permalink" href="perlsource.html#AUTHORS">#</a><i>AUTHORS</i></h2>

<p>This file lists everyone who&#39;s contributed to Perl. If you submit a patch, you should add your name to this file as part of the patch.</p>

<h2 id="MANIFEST"><a class="permalink" href="perlsource.html#MANIFEST">#</a><i>MANIFEST</i></h2>

<p>The <i>MANIFEST</i> file in the root of the source tree contains a list of every file in the Perl core, as well as a brief description of each file.</p>

<p>You can get an overview of all the files with this command:</p>

<pre><code class="plaintext">% perl -lne &#39;print if /^[^\/]+\.[ch]\s+/&#39; MANIFEST</code></pre>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
